package org.tea.inventory.enums;

import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * @author hanzy
 * @description 兑换方式
 * @date 2023年04月06日 14:03
 */
public enum DeliveryTypeEnum {
    NO_EXPRESS("0", "办公室领取"),
    EXPRESS("1", "快递"),
    CDkey("2", "券码兑换"),
    OFFLINE("3", "线下组织"),
    MOBILE_RECHARGE("4", "直充");

    @Getter
    @Setter
    private String code;
    @Getter
    @Setter
    private String content;

    DeliveryTypeEnum(String code, String content) {
        this.code = code;
        this.content = content;
    }

    public static String getContentByName(String code) {
        for (DeliveryTypeEnum productAttributeEnum : DeliveryTypeEnum.values()) {
            if (Objects.equals(productAttributeEnum.getCode(), code)) {
                return productAttributeEnum.getContent();
            }
        }
        return "";
    }
}
